attribute vec3 a_posL;
attribute vec3 a_velocityL;
uniform float u_lifetime;
uniform float u_totaltime;
uniform mat4 u_mvp;
uniform float u_distanceToCamera;
varying float v_fade_alpha;
void main()
{	
	vec4 posW= u_mvp * vec4(a_posL, 1.0);
	vec4 velW = u_mvp * vec4(a_velocityL, 0.0);
	gl_Position = posW + velW * u_totaltime * 100.0;
	v_fade_alpha = ((u_lifetime - u_totaltime) / u_lifetime);
	gl_PointSize = 200000.0 * v_fade_alpha / u_distanceToCamera;
}
